/*
 * epoll.h
 *
 *  Created on: 2010-10-17
 *      Author: tan
 */

#ifndef EPOLL_H_
#define EPOLL_H_


#include "std_network.h"
#include "networkException.h"
#include <iostream>

using namespace std;

namespace light {
namespace network {

//typedef int (*AcceptHandler)(int clientFD)

class Epoll {

	enum NetType{UDP=0, TCP};

public:
	void bind(const char* ip, const unsigned int& port) throw(NetworkException);
	void start() throw(NetworkException);

private:
	void onAccept() throw(NetworkException);

private:
	int localFD;

public:
	Epoll() throw(NetworkException);
	virtual ~Epoll();
};

}
}

#endif /* EPOLL_H_ */
